package net.alche.fa.core.doing.sub;

import net.alche.fa.core.FaClass;
import net.alche.fa.core.FaPlatform;
import net.alche.fa.core.model.FaValue;

// 做为 Integer/Long/Double的替代
public class LangStaticUtil extends FaObjectSubAbs {
  public FaValue classInteger = null;
  public FaValue classLong = null;
  public FaValue classDouble = null;
  public FaValue classString = null;

  public LangStaticUtil() {
  }

  @Override
  public void setPlat(FaPlatform plat) {
    this.plat = plat;
    classInteger = newCls(FaValue._INT, "int");
    classLong = newCls(FaValue._LONG, "long");
    classDouble = newCls(FaValue._DOUBLE, "double");
    classString = newCls(FaValue._STRING, "String");
  }

  FaValue newCls(char ch, String val) {
    FaValue fav = new FaValue();
    FaClass fc = new FaClass(val);
    fc.setPlat(plat);
    fav.aiData(fc);
    fav.objType = "FaClass";
    return fav;
  }

  public static int parseInt(String str) {
    return Integer.parseInt(str);
  }
  public static long parseLong(String str) {
    return Long.parseLong(str);
  }
}